package com.exp.collection;

import java.util.ArrayList;

public class AddElement {
	public static ArrayList<Integer>[] addItem(ArrayList<Integer>[] a , int pos) {
		ArrayList<Integer>[] res = new ArrayList[a.length + 1];
		for(int i=0;i<pos;i++) {
			res[i] = new ArrayList<Integer>();
			res[i] = a[i];
			}
		res[pos] = new ArrayList<Integer>();
		res[pos].add(1000);
		for(int j=pos+1;j<res.length;j++) {
			res[j] = new ArrayList<Integer>();
			res[j] = a[pos];
			pos++;
		}
		return res;
	}

}
